﻿<UserControl x:Class="StockholmsStad.Windows.UI.Modules.Maintenance.Views.TabItemTemplateView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Converters="clr-namespace:StockholmsStad.Windows.UI.Infrastructure.Converters;assembly=StockholmsStad.Windows.UI.Infrastructure"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d">
    <UserControl.Resources>
        <Converters:MarriageCertificateTypeToStringConverter x:Key="enumConverter" />
    </UserControl.Resources>
        
	<Grid Margin="10,10,10,10">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="Auto"/>
			<ColumnDefinition Width="10"/>
			<ColumnDefinition Width="Auto"/>
			<ColumnDefinition Width="10"/>
			<ColumnDefinition Width="Auto"/>
			<ColumnDefinition Width="*"/>
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>

		<ComboBox x:Name="ComboBoxMarriageCertificateTypes" Grid.Row="0" Grid.Column="0"
			SelectedItem="{Binding SelectedMarriageCertificateType}" 
			SelectionChanged="ComboBoxMarriageCertificateTypes_SelectionChanged" MinWidth="120">
			<ComboBox.ItemTemplate>
				<DataTemplate>
					<TextBlock Text="{Binding Converter={StaticResource enumConverter}}" />
				</DataTemplate>
			</ComboBox.ItemTemplate>
		</ComboBox>

        <ComboBox x:Name="ComboBoxMarriageCertificateLanguages" Grid.Row="0" Grid.Column="2" Visibility="Visible"
			SelectedItem="{Binding SelectedLanguage, UpdateSourceTrigger=Explicit}" 
			SelectionChanged="ComboBoxMarriageCertificateLanguages_SelectionChanged" MinWidth="120" DisplayMemberPath="Name">
        </ComboBox>

        <ComboBox x:Name="ComboBoxAllLanguages" Grid.Row="0" Grid.Column="2" Visibility="Hidden"
			SelectedItem="{Binding SelectedLanguage, UpdateSourceTrigger=Explicit}" 
			MinWidth="120" DisplayMemberPath="Name">
        </ComboBox>

        <Label Content="Rubrik:" Grid.Row="1" Grid.Column="0" />
		<Label Content="Underrubrik:" Grid.Row="2" Grid.Column="0" />
		<Label Content="Versus:" Grid.Row="3" Grid.Column="0" />
		<Label Content="Ovanfördatum:" Grid.Row="4" Grid.Column="0" />
		<Label Content="Ort:" Grid.Row="5" Grid.Column="0" />
		<Label Content="Under datum:" Grid.Row="6" Grid.Column="0" />
		<Label Content="Streck:" Grid.Row="7" Grid.Column="0" />
		<Label Content="Utfärdare:" Grid.Row="8" Grid.Column="0" />
		
		<TextBox x:Name="TextBoxHeading" Text="{Binding Heading, Mode=TwoWay, UpdateSourceTrigger=Explicit}" Grid.Row="1" Grid.Column="2" Margin="0,2,0,0" KeyUp="TextBoxHeading_KeyUp" />
		<TextBox x:Name="TextBoxInception" Text="{Binding Inception, Mode=TwoWay, UpdateSourceTrigger=Explicit}" Grid.Row="2" Grid.Column="2" Margin="0,2,0,0" KeyUp="TextBoxHeading_KeyUp" />
		<TextBox x:Name="TextBoxBetweenNames" Text="{Binding BetweenNames, Mode=TwoWay, UpdateSourceTrigger=Explicit}" Grid.Row="3" Grid.Column="2" Margin="0,2,0,0" KeyUp="TextBoxHeading_KeyUp" />
		<TextBox x:Name="TextBoxAboveDate" Text="{Binding AboveDate, Mode=TwoWay, UpdateSourceTrigger=Explicit}" Grid.Row="4" Grid.Column="2" Margin="0,2,0,0" KeyUp="TextBoxHeading_KeyUp" />
		<TextBox x:Name="TextBoxCity" Text="{Binding City, Mode=TwoWay, UpdateSourceTrigger=Explicit}" Grid.Row="5" Grid.Column="2" Margin="0,2,0,0" KeyUp="TextBoxHeading_KeyUp" />
		<TextBox x:Name="TextBoxBelowDate" Text="{Binding BelowDate, Mode=TwoWay, UpdateSourceTrigger=Explicit}" Grid.Row="6" Grid.Column="2" Margin="0,2,0,0" KeyUp="TextBoxHeading_KeyUp" />
		<TextBox x:Name="TextBoxSignLine" Text="{Binding SignLine, Mode=TwoWay, UpdateSourceTrigger=Explicit}" Grid.Row="7" Grid.Column="2" Margin="0,2,0,0" KeyUp="TextBoxHeading_KeyUp" />
		<TextBox x:Name="TextBoxBelowSignature" Text="{Binding BelowSignature, Mode=TwoWay, UpdateSourceTrigger=Explicit}" Grid.Row="8" Grid.Column="2" Margin="0,2,0,0" KeyUp="TextBoxHeading_KeyUp" />
		
		<StackPanel VerticalAlignment="Top" HorizontalAlignment="Left" Grid.Column="4" Grid.Row="0" Grid.RowSpan="11">
			<Button x:Name="AddButton" Margin="0,0,0,2" Content="Ny" Click="AddButton_Click" />
			<Button x:Name="SaveButton" Margin="0,0,0,2" Content="Spara" Click="SaveButton_Click" IsEnabled="False" Command="{Binding SaveCommand}" />
			<Button x:Name="CancelButton" Margin="0,0,0,2" Content="Ångra" Click="CancelButton_Click" IsEnabled="False" />
            <Button x:Name="DeleteButton" Margin="0,0,0,2" Content="Ta bort" Click="DeleteButton_Click" IsEnabled="False" Command="{Binding DeleteCommand}" />
        </StackPanel>
	</Grid>

</UserControl>
